﻿namespace Sidvall.Net.Mail
{
    public class SendGridSystemContext
    {
        #region Public Members

        #region ApiKey

        private string _ApiKey;
        public string ApiKey
        {
            get
            {
                return _ApiKey;
            }
            set
            {
                _ApiKey = value;
            }
        }

        #endregion
        #region FromAddress

        private string _FromAddress;
        public string FromAddress
        {
            get
            {
                return _FromAddress;
            }
            set
            {
                _FromAddress = value;
            }
        }

        #endregion

        #endregion
        #region Factory Members

        #region Current

        private static readonly object _Mutex = new object();
        private static volatile SendGridSystemContext _Current;
        public static SendGridSystemContext Current
        {
            get
            {
                SendGridSystemContext item;

                if (_Current == null)
                {
                    lock (_Mutex)
                    {
                        if (_Current == null)
                        {
                            item = new SendGridSystemContext()
                            {
                            };
                            _Current = item;
                        }
                    }
                }
                return _Current;
            }
            set
            {
                lock (_Mutex)
                {
                    _Current = value;
                }
            }
        }

        #endregion

        #endregion
    }
}
